package models;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;

@Entity
public class Attachment extends BaseModel{
	
	public String name; //附件名称
	public String path; //附件路径
	public Date upload;	//上传时间
	public String keyword; //上传类别
	public Long fid; //Id
	
	public Attachment() {
		
	}
	
	public Attachment(String name,String path,String keyword,Long fid) {
		this.name = name;		
		this.path = path;
		this.keyword = keyword;
		this.fid = fid;
		this.upload = new Date();
	}
	
	public static List<Attachment> findAttachments(String keyword,Long fid){
		return find("keyword = ? and fid = ?",keyword,fid).fetch();
	}
}
